<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/commonEdit.jsp"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<script language="JavaScript"  src="${ctx}/scripts/common/prototype.js"></script>
<script type="text/javascript" src="${ctx}/scripts/common.js"></script>
<script type="text/javascript">
	var ACTION_URL="${ctx}/house_manageOrgAction.do?";
	var COMPANY_ACTION_URL="${ctx}/house_companyAction.do?";

	//获取当前选择的记录
	function getManageOrgId(){
		var obj=document.frames("manageOrgList").document.all;
		return obj.manageOrgId.value;
	}

	function init(){
		$('manageOrgList').src = ACTION_URL + "method=initManageOrgList&companyId="+$F('companyId');
	}

	//弹出删除管理处提示窗口
	function showDelete(){
		if( getManageOrgId() == "" ){
			ErrorAlert('${key.tipsByDelete}');
		}else{
			AlarmConfirm('${key.tipsByDeleteConfirm}',"mainFrame","deleteManageOrg");
		}
	}

	//执行删除
	function deleteManageOrg(){
		var url=ACTION_URL + "method=deleteManageOrg&manageOrgId="+getManageOrgId();
		var myAjax = new Ajax.Request(
	                   url,
	                   {method: 'post', parameters:"" , onComplete: showResponseDelete}
	                   );
	}
	//删除响应
	function showResponseDelete(transport){
		ajaxSubmitException(transport.responseText);
		if(transport.responseText=="false"){
			FailureAlert('${key.doFalse}');
		}else{
			parent.refreshTree();
			//reLoadIFrameListWithQuery();
		}
	}

	//修改管理处
	function openEditManageOrg(){
		if(getManageOrgId()!=""){
			var url=ACTION_URL + "method=initManageOrgEdit&manageOrgId="+getManageOrgId();
			top.windowOpen(url, 'newManageOrg', '${key.editManageOrg}', 380, 380,true, "manageOrgEditIFrame");
		}else{
			ErrorAlert('${key.tipsByModify}');
		}
	}

	//重新加载列表页面,保留查询条件的刷新
	function reLoadIFrameListWithQuery(){
		window.frames("manageOrgList").freshFrame();
	}
	//修改物业公司
	function openEditCompany(){
		if($F(companyId)!=""){
			var url=COMPANY_ACTION_URL + "method=initCompanyEdit&companyId="+$F(companyId);
			top.windowOpen(url, 'editCompany', '${key.modifyCompany}', 325, 360,true, "companyEditIFrame");
		}else{
			ErrorAlert('${key.tipsByModify}');
		}
	}
</script>
</head>
<body onload="init();">
<input id="companyId" type="hidden" value="${companyVO.keyword}" >
<div class="container" >
<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td>
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td>
				<!-----------------------------搜索1----------------------------->

				<table border="0" cellspacing="0" cellpadding="0" width="100%"
					class="bg_search" id="search01">
					<tr>
						<td>

						</td>
					</tr>
				</table>
				<!---------------------------------------------搜索end----------------------></td>
			</tr>
			<tr>
				<td class="bg_toolBar2">
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td width="42%">&nbsp;</td>
						<td width="58%" align="right">
						<!--------------------------右边图标01----------------------------------->
						<table border="0" cellpadding="0" cellspacing="0" id="ico3">
							<tr>
								<td class="toolbarico"></td>
								<td class="toolbarico"><a href="#"
									onclick="openEditCompany();"
									onfocus="this.blur()"><img
									src="${ctx}/images/ico_amend.gif" border="0" align="absbottom"
									alt="${key.modify}" />&nbsp;</a></td>
							</tr>
						</table>
						<!--------------------------右边图标02-----------------------------------><!--------------------------右边图标03-----------------------------------><!--------------------------右边图标end----------------------------------->
						</td>
					</tr>
				</table>
				</td>
			</tr>
			<tr>
				<td valign="top">
				<div>
				<div id="affair" style="height:800px;overflow:auto;background:#fff;">
				<table width="100%" border="0" align="center" cellpadding="5"
					cellspacing="1" id="tab_subMenu1" class="aux_intable_color">
					<tr>
						<td colspan="4" class="aux_titletable">${key.company}</td>
					</tr>
					<tr>
						<td class="aux_intable_td1">${key.companyName}：</td>
						<td class="aux_intable_td2">${companyVO.name}</td>
						<td class="aux_intable_td1">${key.acreage}：</td>
						<td class="aux_intable_td2">${companyVO.acreage} ㎡</td>
					</tr>
					<tr>
						<td class="aux_intable_td1">${key.qualify}：</td>
						<td class="aux_intable_td2">${companyVO.qualifyViewValue}</td>
						<td class="aux_intable_td1">${key.establishDate}：</td>
						<td class="aux_intable_td2">${companyVO.establishDate}</td>
					</tr>
					<tr>
						<td class="aux_intable_td1">${key.corporation}：</td>
						<td class="aux_intable_td2">${companyVO.corporation}</td>
						<td class="aux_intable_td1">${key.address}：</td>
						<td class="aux_intable_td2">${companyVO.address}</td>
					</tr>


					<tr>
						<td colspan="4" class="aux_titletable">${key.manageOrg}</td>
					</tr>
				</table>
				<table width="100%" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td class="bg_toolBar">
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td width="40%">&nbsp;</td>
								<td width="60%" align="right">
								<!--------------------------右边图标01----------------------------------->
								<table border="0" cellpadding="0" cellspacing="0" id="ico3">
									<tr>
										<td class="toolbarico"><a href="#"
											onclick="parent.openNewManageOrg();"
											onfocus="this.blur()"><img
											src="${ctx}/images/ico_newfile.gif" border="0"
											align="absbottom" alt="${key.addManageOrg}" />&nbsp;</a></td>
										<td class="toolbarico"><a href="#"
											onclick="openEditManageOrg();"
											onfocus="this.blur()"><img
											src="${ctx}/images/ico_amend.gif" border="0"
											align="absbottom" alt="${key.editManageOrg}" />&nbsp;</a></td>
										<td class="toolbarico"><a href="#"
											onClick="showDelete();"
											onFocus="this.blur()"><img
											src="${ctx}/images/ico_delete.gif" alt="${key.delete}" width="16"
											height="16" border="0" align="absbottom"></a></td>
									</tr>
								</table>
								</td>
							</tr>
						</table>
						</td>
					</tr>
					<tr>
						<td valign="top"><iframe id="manageOrgList" height="400PX"
							name="manageOrgList" frameborder="0" border="0"
							src="" style="overflow: auto"
							width="100%"></iframe></td>
					</tr>
				</table>
				</div>
				</div>
			</tr>
		</table>
		</td>
	</tr>
</table>
</div>

</body>
</html>
